package com.tensquare.recruit.service;

import com.tensquare.entity.Recruit;
import com.tensquare.recruit.dao.RecruitDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecruitService {

    @Autowired
    private RecruitDao recruitDao;

    public List<Recruit> findTop4ByStateOrderByCreatetimeDesc(int state){

        return recruitDao.findTop4ByStateOrderByCreatetimeDesc(state);
    }

    /**
     * 最新职位列表
     * @param state
     * @return
     */
    public List<Recruit> newlist(int state){

        return recruitDao.findTop12ByStateNotOrderByCreatetimeDesc(state);
    }
}
